package com.theten52.demo.demo1;

/**
 * 标识符校验
 *
 * @author wangjin
 * @date 2020/6/9
 */
public class IdDemo {
    public static void main(String[] args) {
        int startNumber = 0;
        int partNumber = 0;
        for (int i = 0x0000; i <= 0x10ffff; i++) {
            if (Character.isJavaIdentifierStart(i)) {
                startNumber++;
            }
            if (Character.isJavaIdentifierPart(i)) {
                partNumber++;
            }
        }
        System.out.println("Unicode字符集个数：" + (0x10ffff + 1));
        System.out.println("可作为标识符首字符的字符个数：" + startNumber);
        System.out.println("可作为标识符一部分的字符个数：" + partNumber);
        System.out.println("二者之差：" + (partNumber - startNumber));
    }
}
